<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateCommonPushBind extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('common_push_bind', function (Blueprint $table) {
            $table->id();

            $table->unsignedBigInteger("rmsUserId")->default(0)->comment("rmsUserId");
            $table->unsignedTinyInteger("mobileBrand")->default(0)->comment("手机品牌 1 - 小米 2 - 华为");
            $table->string("regId", 180)->default("")->comment("设备在品牌下的注册唯一标示");
            $table->string("sign", 64)->default("")->comment("设备推送唯一值");
            $table->unsignedTinyInteger("status")->default(1)->comment("设备状态 0 - 失效 1 - 正常");

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '通用推送绑定表';
            $table->index(["sign"], "idx_sign");
            $table->index(["rmsUserId"], "idx_rmsUserId");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('common_push_bind');
    }
}
